package com.video.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.video.common.dto.VideoDto;
import com.video.entity.Video;
import com.video.mapper.VideoMapper;
import com.video.service.VideoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author maomao
 */
@Service
public class VideoServiceImpl extends ServiceImpl<VideoMapper, Video> implements VideoService {

    @Resource
    private VideoMapper videoMapper;

    @Override
    public IPage<VideoDto> getUserUploadVideo(Page<VideoDto> videoDtoPage, Long userId, String keyWord) {
        return videoMapper.getUserUploadVideo(videoDtoPage, userId, keyWord);
    }

    @Override
    public VideoDto getVideo(Long videoId) {
        return videoMapper.getVideo(videoId);
    }

    @Override
    public IPage<VideoDto> listVideo(Page<VideoDto> videoDtoPage, Integer categoryId, Integer industryId, Integer platformId, String keyword) {
        return videoMapper.listVideo(videoDtoPage, categoryId, industryId, platformId, keyword);
    }

    @Override
    public Long getMaxVideoId() {
        return videoMapper.getMaxVideoId();
    }
}
